/**
 * 侧边栏
 */

import Pubsub from '../../helper/Pubsub.js';

class Sidebar {
  constructor($sidebars) {

    Pubsub.subscribe('sidebar-folder-open', () => {
      $sidebars.folder.show();
      $$body.addClass('body-open-folder');
    });

    Pubsub.subscribe('sidebar-folder-close', () => {
      $sidebars.folder.hide();
      $$body.removeClass('body-open-folder');
    });

    Pubsub.subscribe('sidebar-directory-open', () => {
      $sidebars.directory.show();
      $$body.addClass('body-open-directory');
    });

    Pubsub.subscribe('sidebar-directory-close', () => {
      $sidebars.directory.hide();
      $$body.removeClass('body-open-directory');
    });

    /*Pubsub.subscribe('sidebar-history-open', () => {
      $sidebar.hide();
      $sidebars.history.show();
      afterOpenSidebar();
    });

    Pubsub.subscribe('sidebar-history-close', () => {
      $sidebars.history.hide();
      afterCloseSidebar();
    });*/
  }
}

export default Sidebar;